<form class="layui-form" style="padding: 0 50px 0 0;width: 600px;" action="{:url('wendasns/question/edit')}" method="post">
      <script type="text/html" template>
        <input type="hidden" name="id" value="{{ d.params.id || 0 }}">
      </script>  
      

  <div class="layui-form-item">
    <label class="layui-form-label">作者</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" value="{{ d.params.username || '' }}" class="layui-input layui-disabled" disabled>
      </script>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">标题</label>
    <div class="layui-input-block">
      <script type="text/html" template>
        <input type="text" name="title" value="{{ d.params.title || '' }}" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">问题描述</label>
    <div class="layui-input-block">
      <script type="text/html" template lay-done="layui.data.done()">
        <textarea id="J_textarea" style="display: none;" name="content" data-id="">{{ d.params.content || '' }}</textarea>
      </script>
    </div>
  </div>

  
  <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label">分类</label>
            <div class="layui-input-inline">
            <script type="text/html" template>
              <select name="category_id">
                {volist name="category" id="item"}
                <option value="{$item.id}" {{# if(d.params.category_id=={$item.id}){ }}selected="selected"{{# } }}>{$item.name}</option>
                {/volist}
              </select>
            </script>
            </div>
          </div>
        </div>
        
  <div class="layui-form-item">
    <label class="layui-form-label">标签</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="tags" value="{{ d.params.tags || '' }}" class="layui-input">
      </script>
    </div>
    <div class="layui-form-mid layui-word-aux">多个标签用户空格或英文,号隔开</div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">点赞数</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="order" value="{{ d.params.order || 0 }}" lay-verify="number" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">浏览量</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="visits" value="{{ d.params.visits || 0 }}" lay-verify="number" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">收藏量</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="collect" value="{{ d.params.collect || 0 }}" lay-verify="number" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">举报数</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="report" value="{{ d.params.report || 0 }}" lay-verify="number" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">回答数</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="answer" value="{{ d.params.answer || 0 }}" lay-verify="number" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">提问IP</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="ip" value="{{ d.params.ip || '' }}" lay-verify="ip" class="layui-input">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">提问来源</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
          <select name="client">
          	<option value="">无</option>
            <option value="Android" {{# if(d.params.status=='Android'){ }}selected="selected"{{# } }}>Android</option>
            <option value="iPhone" {{# if(d.params.status=='iPhone'){ }}selected="selected"{{# } }}>iPhone</option>
            <option value="Mac" {{# if(d.params.status=='Mac'){ }}selected="selected"{{# } }}>Mac</option>
            <option value="iPad" {{# if(d.params.status=='iPad'){ }}selected="selected"{{# } }}>iPad</option>
            <option value="Windows" {{# if(d.params.status=='Windows'){ }}selected="selected"{{# } }}>Windows</option>
          </select>
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">发布时间</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
          <input id="J_create_time" type="text" name="create_time" value="{{ d.params.create_time || '' }}" class="layui-input">
      </script>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">置顶</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="radio" name="top" value="1" title="是" {{ d.params.top === 1 ? 'checked="checked"' : '' }}>
        <input type="radio" name="top" value="0" title="否" {{ d.params.top === 0 ? 'checked="checked"' : '' }}>
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">推荐</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="radio" name="recommend" value="1" title="是" {{ d.params.recommend === 1 ? 'checked="checked"' : '' }}>
        <input type="radio" name="recommend" value="0" title="否" {{ d.params.recommend === 0 ? 'checked="checked"' : '' }}>
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">禁止回答</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="radio" name="close" value="1" title="是" {{ d.params.close === 1 ? 'checked="checked"' : '' }}>
        <input type="radio" name="close" value="0" title="否" {{ d.params.close === 0 ? 'checked="checked"' : '' }}>
      </script>
    </div>
    <div class="layui-form-mid layui-word-aux">禁止网友回答问题</div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">删除问题</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="radio" name="remove" value="1" title="是" {{ d.params.remove === 1 ? 'checked="checked"' : '' }}>
        <input type="radio" name="remove" value="0" title="否" {{ d.params.remove === 0 ? 'checked="checked"' : '' }}>
      </script>
    </div>
  </div>

  <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-inline">
            <script type="text/html" template>
              <select name="status" lay-search="">
                <option value="normal" {{# if(d.params.status=='normal'){ }}selected="selected"{{# } }}>正常</option>
                <option value="check" {{# if(d.params.status=='check'){ }}selected="selected"{{# } }}>待审核</option>
              </select>
            </script>
            </div>
          </div>
        </div>
        
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button lay-submit lay-filter="J_ajax_submit_btn" class="layui-btn"><i class="layui-icon layui-icon-ok-circle"></i>提交</button>
    </div>
  </div>
</form>
<script src="/ueditor/ueditor.init.js?v=1618457391"></script>
<script>
layui.data.done = function(){

	var layedit = layui.layedit,laydate = layui.laydate;
	layedit.set({
	  uploadImage: {
	    url: '{:url('wendasns/question/upload')}'
	  },
	  height: 400
	});

	var index = layedit.build('J_textarea');
	layui.$('#J_textarea').attr('data-id',index);
	
	laydate.render({
    elem: '#J_create_time'
    ,type: 'datetime'
  });
}
;!function(){
  var $ = layui.$
  ,form = layui.form;
  
  form.render();

}();
</script>